package com.gao.controller;

import com.gao.entities.Result;
import com.gao.service.IPaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author: suGar
 * @Date: 2022/10/14 9:14
 */
@RestController
@RequestMapping("/payment")
@Slf4j
public class PaymentController {

    @Resource
    private IPaymentFeignService paymentFeignService;

    @GetMapping("{id}")
    public Result getPayment(@PathVariable("id") Integer id) {
        return paymentFeignService.getPayment(id);
    }

    @GetMapping
    public Result getAllPayment() {
        return paymentFeignService.getAllPayments();
    }


}
